import random
guess=0
secret=random.randint(0,9)
time=1
print("猜数字游戏已开始")
while guess !=secret:
    guess=int(input("请输入0-9之间的任意一个数："))
    if guess==secret:
        print("你猜了{}次，猜中了，真厉害！".format(time))
    else:
        if guess<secret:
            print("你猜的数字小于正确答案")
        else:
            print("你猜的数字大于正确答案")
    time+=1
print("游戏结束")